﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class GetInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var InfoID = Request["id"];
        int infoid = 0;
        if (InfoID != null&&InfoID != "")
           infoid = Convert.ToInt32(InfoID.ToString());

        MysqlHelp info = new MysqlHelp();
        string strSQL = "SELECT * FROM resource WHERE id = '" + infoid+"'";
        DataTable DTinfo = info.GetDatabysql(strSQL);
        if(DTinfo.Rows.Count==0)
        {
            Response.Write("无此信息！");
            return;
        }
        Response.Write("<div class='infotitle'>");
        Response.Write(DTinfo.Rows[0]["title"].ToString());
        Response.Write("</div>");
       
        Response.Write("<div class='infodetail'>");
        Response.Write("<table class='infotable'>");
        for(int i=0;i<5;i++)
        {
            string strTemp = "";
            string str = "";
            switch(i)
            {
                case 0: strTemp = "subject"; str = "学科："; break;
                case 1: strTemp = "publisherID"; str = "发布者："; break;
                case 2: strTemp = "updatatime"; str = "更新时间："; break;
                case 3: strTemp = "author"; str = "作者："; break;
                case 4: strTemp = "source"; str = "来源："; break;
            }
            Response.Write("<tr><td>"+str+DTinfo.Rows[0][strTemp].ToString()+"</td></tr>");
        }
        Response.Write("</table>");
        Response.Write("</div>");
        
        Response.Write("<div class='infointro'>");
        Response.Write(DTinfo.Rows[0]["introduction"].ToString());
        Response.Write("</div>");
        Response.Write("<div class='infocomment'></div>");
    }
}
